<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <h3 class="panel-title">入库统计</h3>
    </div>

    <div class="panel-body">
        <div class="row">
            <div class="col-sm-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">统计条件</h3>
                    </div>
                    <div class="panel-body">
                        <form id="statistics-form" class="form-horizontal">
                            <div class="row">
                                <div class="col-sm-3">
                                    <div class="form-group">
                                        <label class="control-label">开始日期:</label>
                                        <input type="date" class="form-control" name="start_date" value="{$start_date|default=date('Y-m-01')}">
                                    </div>
                                </div>
                                <div class="col-sm-3">
                                    <div class="form-group">
                                        <label class="control-label">结束日期:</label>
                                        <input type="date" class="form-control" name="end_date" value="{$end_date|default=date('Y-m-d')}">
                                    </div>
                                </div>
                                <div class="col-sm-3">
                                    <div class="form-group">
                                        <label class="control-label">供应商:</label>
                                        <select class="form-control" name="supplier_id">
                                            <option value="">全部供应商</option>
                                            {foreach $supplierList as $k=>$v}
                                            <option value="{$k}">{$v}</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-3">
                                    <div class="form-group">
                                        <label class="control-label">仓库:</label>
                                        <select class="form-control" name="warehouse_id">
                                            <option value="">全部仓库</option>
                                            {foreach $warehouseList as $k=>$v}
                                            <option value="{$k}">{$v}</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <button type="button" class="btn btn-primary" id="btn-generate-statistics">
                                        <i class="fa fa-bar-chart"></i> 生成统计
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">总体统计</h3>
                    </div>
                    <div class="panel-body">
                        <div class="row" id="total-stats">
                            <div class="col-sm-3">
                                <div class="info-box">
                                    <span class="info-box-icon bg-blue"><i class="fa fa-file-text"></i></span>
                                    <div class="info-box-content">
                                        <span class="info-box-text">入库单总数</span>
                                        <span class="info-box-number" id="total-count">0</span>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-3">
                                <div class="info-box">
                                    <span class="info-box-icon bg-green"><i class="fa fa-money"></i></span>
                                    <div class="info-box-content">
                                        <span class="info-box-text">入库总金额</span>
                                        <span class="info-box-number" id="total-amount">¥0.00</span>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-3">
                                <div class="info-box">
                                    <span class="info-box-icon bg-yellow"><i class="fa fa-calculator"></i></span>
                                    <div class="info-box-content">
                                        <span class="info-box-text">平均金额</span>
                                        <span class="info-box-number" id="avg-amount">¥0.00</span>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-3">
                                <div class="info-box">
                                    <span class="info-box-icon bg-red"><i class="fa fa-calendar"></i></span>
                                    <div class="info-box-content">
                                        <span class="info-box-text">统计期间</span>
                                        <span class="info-box-number" id="period-range">-</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">按供应商统计</h3>
                    </div>
                    <div class="panel-body">
                        <div class="table-responsive">
                            <table class="table table-striped" id="supplier-stats-table">
                                <thead>
                                    <tr>
                                        <th>供应商</th>
                                        <th>入库单数</th>
                                        <th>总金额</th>
                                    </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">按仓库统计</h3>
                    </div>
                    <div class="panel-body">
                        <div class="table-responsive">
                            <table class="table table-striped" id="warehouse-stats-table">
                                <thead>
                                    <tr>
                                        <th>仓库</th>
                                        <th>入库单数</th>
                                        <th>总金额</th>
                                    </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">按日期统计</h3>
                    </div>
                    <div class="panel-body">
                        <div class="table-responsive">
                            <table class="table table-striped" id="daily-stats-table">
                                <thead>
                                    <tr>
                                        <th>日期</th>
                                        <th>入库单数</th>
                                        <th>总金额</th>
                                    </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

